]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Use custom actor for uiGroup
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Mar 2019 10:34:27 +0000 (11:34 +0100)
committerMarco Trevisan <mail@3v1n0.net>
Tue, 12 Mar 2019 00:39:40 +0000 (00:39 +0000)
The bind constraint that replaced the Shell.GenericContainer in commit
f4682748faf4 is subtly different from the previous code:
It forces the actor to have the same size as the stage, rather than just
requesting that size.

This breaks the magnifier which relies on the UI being able to be bigger
than the display size. Fix by going back to using a custom actor.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/646

js/ui/layout.js

index b6cf05c13cb3e0721fb7c47e3947473cd9290bc4..e3c93a92361588aaf1a078a964ab0c531f1888d0 100644 (file)
@@ -160,6 +160,19 @@ var Monitor = class Monitor {
     }
 };
 
+const UiActor = GObject.registerClass(
+class UiActor extends St.Widget {
+    vfunc_get_preferred_width (forHeight) {
+        let width = global.stage.width;
+        return [width, width];
+    }
+
+    vfunc_get_preferred_height (forWidth) {
+        let height = global.stage.height;
+        return [height, height];
+    }
+});
+
 const defaultParams = {
     trackFullscreen: false,
     affectsStruts: false,
@@ -200,12 +213,8 @@ var LayoutManager = GObject.registerClass({
         global.stage.no_clear_hint = true;
 
         // Set up stage hierarchy to group all UI actors under one container.
-        this.uiGroup = new St.Widget({ name: 'uiGroup' });
+        this.uiGroup = new UiActor({ name: 'uiGroup' });
         this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT);
-        this.uiGroup.add_constraint(new Clutter.BindConstraint({
-            source: global.stage,
-            coordinate: Clutter.BindCoordinate.ALL,
-        }));
 
         global.stage.remove_actor(global.window_group);
         this.uiGroup.add_actor(global.window_group);